package com.marvels.approve.process.api.hystrix;

import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSONObject;
import com.marvels.approve.process.api.LoanBasicDataConsumerApi;
import com.marvels.common.dto.MarvelsResultDTO;
import com.marvels.common.exception.MarvelsBusinessException;
import com.marvels.common.exception.MarvelsErrorCode;
import com.marvels.common.utils.MarvelsLogUtil;

@Component
public class LoanBasicDataConsumerApiHystrix implements LoanBasicDataConsumerApi {

	@Override
	public String getBasicDatas() throws MarvelsBusinessException {
		MarvelsResultDTO dto = MarvelsResultDTO.getResult(MarvelsErrorCode.SUCCESS.getValue(), MarvelsErrorCode.SUCCESS.getDesc(),null);
		MarvelsLogUtil.getInstance().info("LoanBasicDataConsumerApi.getBasicDatas direct call success!");
		return JSONObject.toJSONString(dto);
	}

	@Override
	public MarvelsResultDTO getCustomerBasicDatas() throws MarvelsBusinessException {
		MarvelsLogUtil.getInstance().info("LoanBasicDataConsumerApi.getCustomerBasicDatas direct call success!");
		return MarvelsResultDTO.getResult(MarvelsErrorCode.SUCCESS.getValue(), MarvelsErrorCode.SUCCESS.getDesc(),null);
	}
	
}
